﻿Imports System.Data
Partial Class SAAC
    Inherits System.Web.UI.MasterPage

    Dim IDataBase As New Clases.DataBase
    Dim ECConnString As String = ConfigurationManager.AppSettings("dbIP")
    Dim applicationBasePath As String = ConfigurationManager.AppSettings("applicationBasePath")
    Dim dt As New DataTable


    'Controles del Menu
    Dim MenuAdmin As New MenuItem("Administración", "", "", "#")
    Dim Usuarios As New MenuItem("Usuarios", "", "", applicationBasePath & "Content/Administracion/Usuarios.aspx")
    Dim catalogo As New MenuItem("Catálogos", "", "", applicationBasePath & "Content/Administracion/Catalogo.aspx")
    Dim clientes As New MenuItem("Clientes", "", "", applicationBasePath & "Content/Administracion/Clientes.aspx")

    Dim MenuPort As New MenuItem("Portafolio", "", "", "#")
    Dim Movim As New MenuItem("Movimientos", "", "", applicationBasePath & "Content/Portafolio/Movimientos.aspx")
    Dim MovimT As New MenuItem("MovimientosT", "", "", applicationBasePath & "Content/Portafolio/MovimientosT.aspx")

    Dim MenuReportes As New MenuItem("Reportes", "", "", "#")
    Dim Reportes As New MenuItem("Reporte Movimientos", "", "", applicationBasePath & "Content/Reportes/ReporteMovimientos.aspx")
    Dim ReportesInfo As New MenuItem("Reporte Información de Cliente", "", "", applicationBasePath & "Content/Reportes/ReporteInfoCliente.aspx")
    Dim ReportesCartera As New MenuItem("Reporte de Detalle de Cartera", "", "", applicationBasePath & "Content/Reportes/ReporteDetalleCartera.aspx")
    Dim ReportesInversionDisponible As New MenuItem("Reporte Inversión Disponible", "", "", applicationBasePath & "Content/Reportes/ReporteInversionDisponible.aspx")
    Dim ReporteCobroH As New MenuItem("Reporte Cobro de Honorarios", "", "", applicationBasePath & "Content/Reportes/ReporteCobroHon.aspx")
    Dim ReporteMovimientosTitulos As New MenuItem("Reporte de Movimientos Títulos", "", "", applicationBasePath & "Content/Reportes/ReporteMovimientosTitulos.aspx")
    Dim AsignacionInst As New MenuItem("Asignación por Institución", "", "", applicationBasePath & "Content/Reportes/AsignacionInstitucion.aspx")
    Dim ReporteRendimiento As New MenuItem("Reporte de Rendimiento", "", "", applicationBasePath & "Content/Reportes/ReporteRendimiento.aspx")



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then
            lbl_rol.Text = Session("ActiveUserRol")



            If lbl_rol.Text = "Administrador General" Then
                Session("ActiveRole") = 1
                MenuAdmon()

            ElseIf lbl_rol.Text = "Asesor Financiero" Then
                Session("ActiveRole") = 2
                MenuAsesor()

            ElseIf lbl_rol.Text = "Promotor Financiero" Then
                Session("ActiveRole") = 3
                MenuProm()

            Else
                lbl_rol.Text = "Invitado"
                Session("ActiveRole") = 0
                MenuGuest()
            End If


        End If

    End Sub

    Public Sub MenuAdmon()

        Menu1.Items.Add(MenuAdmin)
        MenuAdmin.ChildItems.Add(Usuarios)
        MenuAdmin.ChildItems.Add(catalogo)
        MenuAdmin.ChildItems.Add(clientes)

        Menu1.Items.Add(MenuPort)
        MenuPort.ChildItems.Add(Movim)
        MenuPort.ChildItems.Add(MovimT)

        Menu1.Items.Add(MenuReportes)
        MenuReportes.ChildItems.Add(Reportes)
        MenuReportes.ChildItems.Add(ReportesCartera)
        MenuReportes.ChildItems.Add(ReportesInfo)
        MenuReportes.ChildItems.Add(ReportesInversionDisponible)
        MenuReportes.ChildItems.Add(ReporteCobroH)
        MenuReportes.ChildItems.Add(ReporteMovimientosTitulos)
        MenuReportes.ChildItems.Add(AsignacionInst)
        MenuReportes.ChildItems.Add(ReporteRendimiento)

    End Sub

    Public Sub MenuAsesor()
        Menu1.Items.Add(MenuAdmin)



        Menu1.Items.Add(MenuPort)
        MenuPort.ChildItems.Add(Movim)
        MenuPort.ChildItems.Add(MovimT)

        Menu1.Items.Add(MenuReportes)
        MenuReportes.ChildItems.Add(Reportes)
        MenuReportes.ChildItems.Add(ReportesCartera)
        MenuReportes.ChildItems.Add(ReportesInfo)
        MenuReportes.ChildItems.Add(ReportesInversionDisponible)
        MenuReportes.ChildItems.Add(ReporteMovimientosTitulos)
        MenuReportes.ChildItems.Add(AsignacionInst)
        MenuReportes.ChildItems.Add(ReporteRendimiento)
    End Sub

    Public Sub MenuProm()
        Menu1.Items.Add(MenuReportes)
        MenuReportes.ChildItems.Add(Reportes)
        MenuReportes.ChildItems.Add(ReportesCartera)
        MenuReportes.ChildItems.Add(ReportesInfo)
        MenuReportes.ChildItems.Add(ReportesInversionDisponible)
        MenuReportes.ChildItems.Add(ReporteMovimientosTitulos)
        MenuReportes.ChildItems.Add(AsignacionInst)
        MenuReportes.ChildItems.Add(ReporteRendimiento)
    End Sub

    Public Sub MenuGuest()



    End Sub



   
End Class

